/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Aptech.Service;

import Aptech.DAL.MgBuilts;
import Aptech.DALInterface.BuiltsInterface;
import HibernateMappingPoJo.Builts;
import java.util.Iterator;
import java.util.List;

/**
 *
 * @author nkhoan
 */
public class SV_Buitls {

    BuiltsInterface mgBuilts ;

    public SV_Buitls(){
        mgBuilts = new MgBuilts();
        
    }


    public  Builts[] getAllBuilt(){
       List<Builts>  list = mgBuilts.getAllBuilt();

        Builts[] listBuilts = new Builts[list.size()];
        if (list != null) {
            Iterator<Builts> iter = list.iterator();
            int i = 0;
            while (iter.hasNext()) {
                Builts tptd = (Builts) iter.next();
                listBuilts[i] = tptd;
                i++;
            }
        }
        return listBuilts;
    }

    public void addBuilt(Builts builts){
        mgBuilts.addBuilt(builts);
    }

     public void deleteBuilt(String id){
          mgBuilts.deleteBuilt(id);
     }

     public void editBuilt(Builts builts){
         mgBuilts.editBuilt(builts);
     }
     
     public Builts getBuiltByID(String id){
    	return mgBuilts.getBuiltsByID(id);
     }
}
